<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var date = new Date();
        // 年
        console.log(date.getFullYear());
        // 月
        console.log(date.getMonth() + 1);
        // 日
        console.log(date.getDate());
        // 星期
        console.log(date.getDay());
        // 时
        console.log(date.getHours());
        // 分
        console.log(date.getMinutes());
        // 秒
        console.log(date.getSeconds());
    </script>
</head>

<body>

</body>

</html>